package com.crcc.common.exception;

public class ServiceException extends BaseException {
    private int status = 400;

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(String message, int status) {
        super(message);
        this.status = status;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(String message, Throwable cause, int status) {
        super(message, cause);
        this.status = status;
    }

    public ServiceException(BaseExceptionEnum exceptionEnum) {
        this(exceptionEnum.getCode(), exceptionEnum.getMessage());
    }

    public ServiceException(BaseExceptionEnum exceptionEnum, Throwable e) {
        this(exceptionEnum.getCode(), exceptionEnum.getMessage(), e);
    }

    public ServiceException(String messageCode, String messageInformation) {
        super(messageCode, messageInformation);
    }

    public ServiceException(String messageCode, String messageInformation, Throwable e) {
        super(messageCode, messageInformation, e);
    }

    public int getStatus() {
        return status;
    }

}
